package com.czg.designmode.factory.abstracts;

/**
 * 测试类
 *
 * @author chenzhigang
 */
public class AbstractFactoryTest {

    public static void main(String[] args) {
        // 获取男人衣柜
        AbstractFactory manClosetFactory = FactoryProducer.getFactory(1);
        if (null == manClosetFactory) {
            return;
        }
        ManCloset shoeManCloset = manClosetFactory.getManCloset(ManEnum.SHOE.getType());
        shoeManCloset.dress();
        ManCloset jacketManCloset = manClosetFactory.getManCloset(ManEnum.JACKET.getType());
        jacketManCloset.dress();
        ManCloset trousersManCloset = manClosetFactory.getManCloset(ManEnum.TROUSERS.getType());
        trousersManCloset.dress();

        // 获取女人衣柜
        AbstractFactory womenClosetFactory = FactoryProducer.getFactory(2);
        if (null == womenClosetFactory) {
            return;
        }
        WomenCloset bootWomenCloset = womenClosetFactory.getWomenCloset(WomenEnum.BOOT.getType());
        bootWomenCloset.buy();
    }

}
